-
Notifications
You must be signed in to change notification settings - Fork 8.3k
[Backport v4.1-branch] net: dhcpv4: Fixes for Pad option handling and Request message xid value #89668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
In case the received DHCP message is malformed and contains invalid message type, the code responsible for matching message type with a string would assert. This shouldn't be the case that external conditions (like receiving malformed packet) trigger asserts in the system. Therefore modify that code, to return "invalid" string in such case instead. Signed-off-by: Robert Lubos <[email protected]> (cherry picked from commit f4408c0)
Pad option (option code 0) can be present in between other options for alignment. The option has a fixed 1-byte length (i. e. no length field), therefore it did not fall under the common processing code for unrecognized options (which include the length field at the second byte). Therefore, not processing this option explicitly could disturb other options processing, as the parser would wrongly interpret the next option code as the length field. This commit adds Pad option handling to fix the issue. Signed-off-by: Robert Lubos <[email protected]> (cherry picked from commit 9d54465)
According to RFC 2131, DHCP clients should use the same xid as received in the Offer message when sending DHCP Requests. Therefore, when generating DHCP Request message, the xid value should not be incremented. One vague topic is whether the xid value should be updated when sending Requests from Renewing or Rebinding states, however RFC makes no exception for those states, and other implementations (dhclient, lwip) seem to reuse the same xid in such cases, so comply with this behavior. Signed-off-by: Robert Lubos <[email protected]> (cherry picked from commit 45a1cf7)
Add Pad option to the DHCP packets generated by the fake server, to verify the client processes them correctly. Signed-off-by: Robert Lubos <[email protected]> (cherry picked from commit eabeb84)
According to RFC 2131 Request message Exchange ID should be the same as the one received in the Offer message from the server. Modify test to verify that. Signed-off-by: Robert Lubos <[email protected]> (cherry picked from commit 1c46508)
|
|
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
|



Backport 1c46508~5..1c46508 from #89534.
Fixes #89641